package com.siyuanren.gcocp.mapper;

import com.siyuanren.gcocp.dto.ContentDTO;
import com.siyuanren.gcocp.entity.WxCourseContent;
import com.siyuanren.gcocp.mapper.base.WxCourseContentMapper;
import com.siyuanren.gcocp.vo.QueryChildContentVO;
import com.siyuanren.gcocp.vo.QueryContentVO;
import com.siyuanren.gcocp.vo.QueryFavoritesVO;

import java.util.List;

/**
 * Created by   anxing
 * Project_name gcocp-parent
 * Path         com.siyuanren.gcocp.mapper
 * Date         2018/4/17
 * Time         13:08
 * Description
 */
public interface MyWxContentMapper extends WxCourseContentMapper{

    /**
     * 返回课程内容列表
     * @param queryContentVO
     * @return
     *     SELECT con.*, t.`teacher_img`, t.`teacher_name` FROM wx_course_content con, wx_teacher t, wx_course_chapter chap
    WHERE con.chapter_id=37 AND con.parent_id = 0 AND con.`chapter_id`=chap.`id` AND chap.`teacher_id`=t.id AND con.`available`=1
     */
    public List<ContentDTO> getContentList(QueryContentVO queryContentVO) throws Exception;
    /**
     * 返回子课程内容列表. 用于嵌套的子课程内容列表
     * @param queryChildContentVO
     * @return
     * SELECT * FROM wx_course_content WHERE parent_id=6 AND `available`=1
     */
    public List<ContentDTO> getChildContentList(QueryChildContentVO queryChildContentVO) throws Exception;

    /**
     * 返回收藏内容列表
     * @param queryFavoritesVO
     * @return
     * SELECT uf.id, uf.`create_time`, con.`chapter_id`, con.`content_role`, con.`content_text`, con.`content_title`, con.`content_type`, con.`content_url`, con.`resource_id`,
    tea.`teacher_img`, tea.`teacher_name`
    FROM wx_user_favorite uf, wx_course_content con, wx_course_chapter chapter, wx_teacher tea
    WHERE uf.`user_id`=1 AND uf.`course_id`=1 AND uf.`content_id`=con.`id` AND con.`chapter_id`=chapter.id AND chapter.`teacher_id`=tea.`id` AND uf.`available`=1
     */
    public List<WxCourseContent> getFavoriteContentList(QueryFavoritesVO queryFavoritesVO) throws Exception;

}
